//
//  UIlabel+Extesion.swift
//  weibo
//
//  Created by 上官风雨 on 15/11/14.
//  Copyright © 2015年 上官风雨. All rights reserved.
//

import UIKit

extension UILabel {
    
    convenience init(title:String,size:CGFloat,color:UIColor,margin:CGFloat = 0){
        self.init()
        text = title
        font = UIFont.systemFontOfSize(size)
        textColor = color
        numberOfLines = 0
        textAlignment = .Center
        sizeToFit()
        if margin != 0{
            
            preferredMaxLayoutWidth = screenW - 2 * margin
            textAlignment = .Left
        }
        
    }
    
    
    
}
